package com.huawei.service;

public class Rockpaperscissorss implements Rockpaperscissors{
    /**
     * @param person
     * @param computer
     * @Description: the rule of rockpaperscissors
     * 对应人的输赢平，0-lose，1-win，2-peace
     */
    @Override
    public int gameStandardOfPerson(int person, int computer) {
        //0-rock，1-scissors，2-paper
        int result = 0;
        switch (person){
            case 0:
                if(computer == 0){
                    result =2;
                    System.out.println("peace");
                }else if(computer == 1){
                    result = 1;
                    System.out.println("win");
                } else if(computer == 2){
                    result = 0;
                    System.out.println("lose");
                } else{
                    System.out.println("-404-");
                }
                break;
            case 1:break;
            case 2:break;
            default:
        }
        return result;
    }
}

